<?php
$admin_pre_folder = "../../";

include '../../class.php';

$id = (int)$_POST['id'];

if ($_POST['bannercredit']<>"")
{
	$set[] = "`user_bannerpoint` = `user_bannerpoint` + '".((int)$_POST['bannercredit'])."'";
}

if ($_POST['surfcredit']<>"")
{
	$set[] = "`user_point` = `user_point` + '".(((int)$_POST['surfcredit'])*10)."'";
}

if ($_POST['goldstatus']<>0)
{
	$sql->mysql_select("users", "*","user_id = ".$id);
	$row = $sql->get_line();
	
	if ($row['user_type']=="Gold" && $row['user_type_date']>time())
	{
		$set[] = "`user_type_date` = `user_type_date` + '".(((int)$_POST['goldstatus'])*30*24*60*60)."'";
	}
}

if ($sql->mysql_query("UPDATE `users` SET ".implode(",", $set)." WHERE `user_id` = '".$id."'"))
{
	$_SESSION['message']['highlight'][] = "Adatok sikeresen módosítva lettek az adatbázisban!";
}

header("Location: ".$admin_pre_folder."index.php?".$_POST['module']);
?>